﻿using CatUtils.Utils.Currency;
using CatUtils.Utils.Currency.IoUtils;
using CatUtils.Utils.Currency.TextUtils;
using System;
using System.Windows.Forms;

namespace RabbitDownload.WebSite.Konachan.ALL
{
    public partial class KonachanAllControl : UserControl
    {
        public KonachanAllControl()
        {
            InitializeComponent();
            InitView();
        }

        private void InitView()
        {
            comboBox1.SelectedIndex = 0;
            KonachanStaticValue.ImgScore = TextHelper.StringToInt(textBox3.Text);
            KonachanStaticValue.UseLogFlag1 = checkBox1.Checked;
            KonachanStaticValue.ExcludeFlag = checkBox2.Checked;
            FileHelper.FileExits(KonachanStaticValue.KoachanOldListPath1, true);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            new KonachanAllScanner().Start(textBox1.Text, textBox2.Text, KonachanStaticValue.AllApi,
                comboBox1.Text, textBox3.Text, checkBox1.Checked, checkBox2.Checked);
        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            Helper.ViewHelper.TextBoxHelper.PrintCount(e);
        }

        private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
        {
            Helper.ViewHelper.TextBoxHelper.PrintCount(e);
        }

        private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
        {
            Helper.ViewHelper.TextBoxHelper.PrintCount(e);
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            KonachanStaticValue.DownLoadMode = comboBox1.Text;
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            KonachanStaticValue.ImgScore = TextHelper.StringToInt(textBox3.Text);
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            KonachanStaticValue.UseLogFlag1 = checkBox1.Checked;
        }

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            KonachanStaticValue.ExcludeFlag = checkBox2.Checked;
        }
    }
}